package org.extframework.ld.xml.base.component;

import org.extframework.ld.content.XmlContent;
import org.extframework.ld.xml.base.DialogItem;
import org.extframework.ld.xml.base.listeners.ComboxBoxListeners;

/**
 * @author : Dong.Li
 * @created : 2013-1-17
 * @version : 1.0
 * @description :
 */
public class ExtComboBox extends DialogItem{

	private int minChars = 1;
	private String cbId;
	private String loadingText = "正在加载信息";

	private String triggerAction = "all";

	private int queryDelay = 300;

	private String mode = "remote";

	private int pageSize = 9;

	private boolean selectOnFocus = true;
	private String store;
	private String displayField = "value";

	private String valueField = "id";

	private int listWidth = 242;

	private String selectValueId = "";
	
	private boolean grow = true;
	
	private boolean border = true;

	private ComboxBoxListeners listeners = new ComboxBoxListeners();

	public int getMinChars() {
		return this.minChars;
	}

	public void setMinChars(int minChars) {
		this.minChars = minChars;
	}

	public String getLoadingText() {
		return this.loadingText;
	}

	public void setLoadingText(String loadingText) {
		this.loadingText = loadingText;
	}

	public String getTriggerAction() {
		return this.triggerAction;
	}

	public void setTriggerAction(String triggerAction) {
		this.triggerAction = triggerAction;
	}

	public int getQueryDelay() {
		return this.queryDelay;
	}

	public void setQueryDelay(int queryDelay) {
		this.queryDelay = queryDelay;
	}

	public String getMode() {
		return this.mode;
	}

	public void setMode(String mode) {
		this.mode = mode;
	}

	public int getPageSize() {
		return this.pageSize;
	}

	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}

	public boolean isSelectOnFocus() {
		return this.selectOnFocus;
	}

	public void setSelectOnFocus(boolean selectOnFocus) {
		this.selectOnFocus = selectOnFocus;
	}

	public String getSelectValueId() {
		return this.selectValueId;
	}

	public void setSelectValueId(String selectValueId) {
		this.selectValueId = selectValueId;
	}

	public String getDisplayField() {
		return this.displayField;
	}

	public void setDisplayField(String displayField) {
		this.displayField = displayField;
	}

	public String getValueField() {
		return this.valueField;
	}

	public void setValueField(String valueField) {
		this.valueField = valueField;
	}

	public String getCbId() {
		return this.cbId;
	}

	public void setCbId(String cbId) {
		this.cbId = cbId;
		/**
		this.store = "##new Ext.data.JsonStore({  url : '"+XmlContent.getRootUrl()+"/sys?web_action=remoteComboBox&cdId="
				+ cbId
				+ "' ,totalProperty : 'totalNum', root : 'details',    fields : ['id','value'] })##";
				**/
		this.store = "##new Ext.data.JsonStore({  url : '/sys?web_action=remoteComboBox&cdId="
				+ cbId
				+ "' ,totalProperty : 'totalNum', root : 'details',    fields : ['id','value'] })##";
	}

	public String getStore() {
		return this.store;
	}

	public void setStore(String store) {
		this.store = store;
	}

	public int getListWidth() {
		return this.listWidth;
	}

	public void setListWidth(int listWidth) {
		this.listWidth = listWidth;
	}

	public ComboxBoxListeners getListeners() {
		return this.listeners;
	}

	public void setListeners(ComboxBoxListeners listeners) {
		this.listeners = listeners;
	}

	public boolean isGrow() {
		return grow;
	}

	public void setGrow(boolean grow) {
		this.grow = grow;
	}

	public boolean isBorder() {
		return border;
	}

	public void setBorder(boolean border) {
		this.border = border;
	}

}
